<?php
    $this->headTitle($this->layout()->title . $this->browsertitle);
    if ($this->robots) {
        $this->headMeta()->appendName('robots', 'index, follow');
    } else {
        $this->headMeta()->appendName('robots', 'noindex, follow');
    }
?>

<div id="sidebar">
    <div class="title">Категории:</div>
    <?php echo $this->listCategory(); ?>
    <div class="title">Теги:</div>    
    <?php echo $this->listTags() ?>
    <div class="title">Статистика:</div>
    <?php include_once 'statistic.phtml'; ?>
</div>
<div id="strlist" class="left">
<?php
    foreach ($this->paginator as $topic) {
        $linkTopic = $this->url(array('id' => $topic->post_id), 'topic'); ?>
<div class="strecord">
    <div class="theme">
        <?php if ($topic->hide) echo 'Hidden: '; ?><a href="<?php
                echo $linkTopic; ?>"><?php echo $topic->title; ?></a>
    </div>
    <div class="dateline">
        Автор: <a href="<?php echo $this->url(array('id' => $topic->user_id), 'author');
                    ?>" class="author"><?php echo $this->nameUser[$topic->user_id]; ?></a><br/>
        <?php echo $this->dateTimeFormat($topic->time_created); ?>
    </div>
    <div class="topic-text">
        <?php echo $this->topicPreview($topic->text_post, $topic->post_id, TRUE); ?>
    </div>
    <p>Категория: <a href="<?php echo $this->url(array('id' => $topic->category_id), 'category') ?>">
    <?php echo $this->nameCategory[$topic->category_id]['name']; ?></a></p>
    <p><?php $tag = $this->viewTags($topic->post_id);
            if ($tag) echo $tag; ?></p>
    <div class="comments_link"><a href="<?php
        echo $linkTopic . '#comment_box'; ?>"><?php
        echo $this->numberOfComments($this->arrayCount[$topic->post_id]['comments']); ?></a> | <a href="<?php
        echo $this->url(array('id' => $topic->post_id,
                              'hide' => 'reply'), 'topic') . '#comment_add'; ?>">Оставить комментарий</a>
    </div>
</div>
<?php } ?>

<?php echo $this->paginationControl($this->paginator, 'Elastic', 'main_paginator.phtml'); ?>
</div>
